package com.example.poemtest.mine;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.poemtest.Activity.LoginActivity;
import com.example.poemtest.R;

import java.util.Timer;
import java.util.TimerTask;

/**
 * 注销页面
 */
public class LayOff extends AppCompatActivity {

    private Button btn;
    private Button btnTodayPlanAddDialog;
    private AlertDialog dialog;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_lay_off);
        btn = findViewById(R.id.btn_zhuxiao);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //跳转到登陆页面
                final Intent itent = new Intent(LayOff.this, LoginActivity.class); //你要转向的Activity
                Timer timer = new Timer();
                TimerTask task = new TimerTask() {
                    @Override
                    public void run() {
                        startActivity(itent); //执行
                    }
                };
                timer.schedule(task, 1000 * 3); //3秒后
            }
        });
    }
}